package com.hs.hlw.credit.system.common;

/**
 * Created by yangbajing(yangbajing@gmail.com) on 2016-09-2.
 */
public class CsConstants {

    public static final String OWNER_TOKEN = "hl-o-t";

    public static final String X_REAL_IP = "X-Real-Ip";

    public static final String VALIDATE_CODE = "validate-code";

    public static final String CC_OWNER_TOKEN = "hl-o-t";

    public static final String SSO_COOKIE = "haishu-sc";

    /**
     * redis缓存数据存活时间,单位秒(SECONDS),等级分5级,分别是:
     */
    public static final int REDIS_TIME_LIVE_1 = 15;//15秒
    public static final int REDIS_TIME_LIVE_2 = 30;//30秒
    public static final int REDIS_TIME_LIVE_3 = 60;//1分钟
    public static final int REDIS_TIME_LIVE_4 = 60 * 30;//30分钟
    public static final int REDIS_TIME_LIVE_5 = 60 * 60;//1小时

    public static class USER {
        public final static int STATE_DISABLED = 0;
        public final static int STATE_ENABLED = 1;
    }

    public static class SIGN {
        /**
         * 登录名登录
         */
        public final static int SIGNIN_LOGINNAME = 0;
        /**
         * 手机登录
         */
        public final static int SIGNIN_PHONE = 1;
        /**
         * 邮箱登录
         */
        public final static int SIGNIN_EMAIL = 2;
    }

    public static class ROLE {
        public final static int STATE_DISABLED = 0;
        public final static int STATE_ENABLED = 1;
    }

    public static class ORGANIZATION {
        /**
         * 集团公司
         */
        public final static int TYPE_PARENT_COMPANY = 0;
        /**
         * 部门
         */
        public final static int TYPE_DEPARTMENT = 1;
        /**
         * 子公司
         */
        public final static int TYPE_SUBSIDIARY = 2;
    }


    /**
     * 操作类型定义
     */
    public static class OPT_TYPE {
        public final static int DIRECTORY_READ = 0;
        public final static int DIRECTORY_WRITE = 1;
        public final static int DIRECTORY_UPDATE = 2;
        public final static int DIRECTORY_DELETE = 3;

        public final static int ITEM_READ = 10;
        public final static int ITEM_WRITE = 11;
        public final static int ITEM_UPDATE = 12;
        public final static int ITEM_DELETE = 13;

        public final static int ITEM_APPLY = 14;//数据项的申请
        public final static int ITEM_APPLY_READ = 15;//数据项的读取
        public final static int ITEM_APPLY_UPDATE = 16;//数据项的更新
        public final static int ITEM_APPLY_DELETE = 17;//数据项的删除


        public final static int ITEM_FIELD_READ = 20;//数据库字段映射信息读取
        public final static int ITEM_FIELD_WRITE = 21;//数据库字段映射信息写入
        public final static int ITEM_FIELD_UPDATE = 22;//数据库字段映射信息修改
        public final static int ITEM_FIELD_DELETE = 23;//数据库字段映射信息删除

    }

    public static class DATA_TYPE {
        public final static String DATA_TYPE_INT = "int,bigint,integer,boolean,int4";
        public final static String DATA_TYPE_DOUBLE = "double,numeric,float";
        public final static String DATA_TYPE_STRING = "string,char,varchar,character_varying,uuid,text";
        public final static String DATA_TYPE_DATE = "date,datetime,timestamp";
    }
}